//package com.mobile.web.config.datasource;
//import org.apache.ibatis.session.SqlSessionFactory;
//import org.mybatis.spring.SqlSessionFactoryBean;
//import org.mybatis.spring.SqlSessionTemplate;
//import org.mybatis.spring.annotation.MapperScan;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.beans.factory.annotation.Qualifier;
//import org.springframework.context.annotation.Bean;
//import org.springframework.context.annotation.Configuration;
//import org.springframework.core.io.support.PathMatchingResourcePatternResolver;
//
//import javax.sql.DataSource;
//
//@Configuration
//@MapperScan(basePackages = {"com.mobile.service.daoSqlserver"}, sqlSessionFactoryRef = "sqlSessionFactoryDb2")
//public class SqlserverConfig {
//    @Autowired
//    @Qualifier("db2")
//    private DataSource dataSourceDb2;
//
//    @Bean
//    public SqlSessionFactory sqlSessionFactoryDb2() throws Exception {
//        SqlSessionFactoryBean factoryBean = new SqlSessionFactoryBean();
//        factoryBean.setDataSource(dataSourceDb2);
//        factoryBean.setConfigLocation(new PathMatchingResourcePatternResolver().getResource("classpath:mybatis/mybatis-config.xml"));
//        factoryBean.setMapperLocations(new PathMatchingResourcePatternResolver().getResources("classpath:mapper/sqlserver/*Mapper.xml"));
//        return factoryBean.getObject();
//    }
//
//    @Bean(name = "sqlSessionTemplate2")
//    public SqlSessionTemplate sqlSessionTemplateDb2() throws Exception {
//        return new SqlSessionTemplate(sqlSessionFactoryDb2());
//    }
//
//}
